Wire up Cloud Run deployment - #7
Merged
Merged
Conversation
- scripts/deploy.sh: canonical Cloud Build + gcloud run deploy with git-SHA-pinned image tags for clean rollbacks. - start.sh: drop alembic-on-startup; migrations now run as a separate pre-deploy step (avoids slow Cloud Run cold starts and migration races across concurrent revisions). - docker-compose.yml: add one-shot migrate service so docker compose up keeps auto-migrating in local dev. - README: Production Deployment (Cloud Run) section with the deploy command, pre-deploy migration procedure, and infra inventory. - .env.production.example: prod env-var reference (secrets live in Secret Manager; non-secrets are baked into scripts/deploy.sh).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
scripts/deploy.shfor manual Cloud Run deploys (Cloud Build +gcloud run deploy, image tag pinned to the current git short-SHA).cloud-sql-proxy. Avoids slow Cloud Run cold starts and removes the migration-race risk during concurrent revisions.migrateservice todocker-compose.ymlso local dev keeps auto-migrating.README.mdand add.env.production.exampleas a non-secret reference for prod env vars.Part of #2 (Phase A — Migrate Treepolitics API to Cloud Run). Domain cutover (
api.treepolitics.net) is the remaining piece and is parked pending DNS access; see the latest checkpoint comment on #2 for the resume plan. This PR is independent of that.Test plan
./scripts/deploy.shbuilds + deploys cleanly. New revisiontreepolitics-api-00002-8srserving 100% of traffic with image:acae363./,/health,/docs→ 200POST /auth/register→ 201POST /auth/jwt/login→ 204 + cookies (Domain=.treepolitics.net)GET /auth/me(with cookie) → 200POST /notes+GET /notes(with cookie) → 201 / 200docker compose upstill applies migrations before starting the API (one-shotmigrateruns to completion, thenapiboots).https://api.treepolitics.netonce the domain mapping is in place — tracked separately in Phase A — Migrate Treepolitics API to Cloud Run #2.